/* 全局变量 */
:root {
  --primary-color: #1890ff;
  --primary-hover: #40a9ff;
  --success-color: #52c41a;
  --warning-color: #faad14;
  --danger-color: #ff4d4f;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --menu-bg: #001529;
  --menu-text: rgba(255, 255, 255, 0.65);
  --menu-hover: rgba(255, 255, 255, 0.95);
  --menu-active: #1890ff;
  
  /* 响应式断点 */
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;
}

/* 重置样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.5;
}

/* 布局 */
.layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
  width: 240px;
  background: var(--menu-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  transition: all 0.3s ease;
  padding-top: 0;
}

.sidebar h2 {
  font-size: 20px;
  font-weight: 600;
  padding: 24px;
  margin: 0;
  color: var(--menu-hover);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar ul {
  list-style: none;
  padding: 16px 8px;
  margin: 0;
}

.sidebar li {
  margin: 4px 0;
}

.sidebar li a {
  color: var(--menu-text);
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 6px;
  display: block;
  font-size: 14px;
  transition: all 0.3s ease;
  line-height: 1.5;
  margin: 0 -8px;
}

.sidebar li a:hover {
  color: var(--menu-hover);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar li.active {
  background: transparent;
}

.sidebar li.active a {
  color: #fff;
  background: var(--menu-active);
  font-weight: 400;
}

/* 主要内容区域 */
.main {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  background: var(--bg-light);
  min-height: 100vh;
}

/* 顶部栏 */
.topbar {
  height: 64px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar .user span {
  color: var(--text-secondary);
  font-size: 14px;
}

.topbar .user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

/* 内容区域 */
.content {
  flex: 1;
  padding: 24px;
}

/* 卡片样式 */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

/* 表格样式 */
.table-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: #fafafa;
  font-weight: 600;
  color: var(--text-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

tr:hover {
  background: #fafafa;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-default {
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-default:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

/* 工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.search-box {
  flex: 1;
  max-width: 320px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 8px 12px;
  padding-left: 36px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1366px) {
  .content {
    padding: 16px;
  }
  
  th, td {
    padding: 12px;
  }
  
  .card, .table-container {
    padding: 16px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 200px;
  }
  
  .main {
    margin-left: 200px;
  }
  
  .topbar {
    padding: 0 16px;
  }
  
  th, td {
    padding: 10px;
  }
  
  .table-container {
    border-radius: 8px;
  }
  
  .card {
    padding: 16px;
    border-radius: 8px;
  }
  
  .form-control {
    padding: 6px 10px;
  }
  
  .btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 0;
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    width: 240px;
    transform: translateX(0);
  }
  
  .main {
    margin-left: 0;
  }
  
  .topbar {
    padding: 0 12px;
  }
  
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .search-box {
    width: 100%;
    margin-bottom: 12px;
  }
  
  .card, .table-container {
    padding: 12px;
    border-radius: 6px;
  }
  
  th, td {
    padding: 8px;
    font-size: 13px;
  }
  
  .search-form {
    flex-direction: column;
  }
  
  .search-buttons {
    width: 100%;
    justify-content: space-between;
    margin-top: 12px;
  }
  
  .search-buttons .btn {
    flex: 1;
    margin-right: 8px;
  }
  
  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .table-header .table-title {
    margin-bottom: 12px;
  }
  
  .operation-links {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 576px) {
  .topbar {
    height: 56px;
  }
  
  .topbar .title {
    font-size: 14px;
  }
  
  .topbar .user span {
    display: none;
  }
  
  .content {
    padding: 12px;
  }
  
  .card, .table-container {
    padding: 10px;
    margin-bottom: 16px;
  }
  
  th, td {
    padding: 6px;
    font-size: 12px;
  }
  
  .btn {
    padding: 4px 10px;
    font-size: 12px;
  }
  
  .operation-link {
    padding: 4px 8px;
    font-size: 12px;
  }
}

/* Tab System */
.tab-container {
  margin-bottom: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: #fff;
  padding: 0 24px;
}

.tab-item {
  padding: 16px 24px;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
  border: none;
  background: none;
  font-weight: 500;
}

.tab-item:hover {
  color: var(--primary-color);
}

.tab-item.active {
  color: var(--primary-color);
  font-weight: 600;
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
}

.tab-content {
  display: none;
  padding: 24px;
}

.tab-content.active {
  display: block;
}

/* Contract Management Specific */
.search-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.search-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.search-buttons {
  display: flex;
  gap: 16px;
}

.table-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.table-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.operation-links {
  display: flex;
  gap: 16px;
}

.operation-link {
  color: var(--primary-color);
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.operation-link:hover {
  color: var(--primary-hover);
}

.operation-link.danger {
  color: var(--danger-color);
}

.operation-link.danger:hover {
  color: #ff7875;
}

/* Additional Responsive Styles */
@media (max-width: 768px) {
  .search-form {
    grid-template-columns: 1fr;
  }
  
  .search-buttons {
    flex-direction: column;
  }
  
  .search-buttons .btn {
    width: 100%;
  }
  
  .search-buttons {
    flex-direction: column;
  }
  
  .search-buttons .btn {
    width: 100%;
  }
  
  .table-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .operation-links {
    flex-wrap: wrap;
  }
}

/* 统一的分页控件样式 */
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
  gap: 8px;
  border: 1px solid #ff4d4f;
  border-radius: 2px;
  display: inline-flex;
  float: right;
  margin-top: 20px;
  margin-bottom: 20px;
}

.pagination button {
  min-width: 32px;
  height: 32px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 12px;
}

.pagination button.active {
  background: var(--primary-color);
  color: #fff;
}

.pagination button:not(.active):hover {
  color: var(--primary-color);
}

.pagination button:first-child, .pagination button:last-child {
  padding: 0 8px;
  background: #f5f5f5;
  color: #666;
  border-right: 1px solid #eee;
  border-left: 1px solid #eee;
}

/* 表格相关统一样式 */
.sticky-header th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fafafa;
}

/* 确保操作按钮垂直堆叠在较小屏幕上 */
@media screen and (max-width: 768px) {
  .table-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .pagination {
    justify-content: center;
    flex-wrap: wrap;
  }
} 